﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace devtm.AutoMapper
{

    public abstract partial class MappingSourceBase : INotifyPropertyChanged
    {

        internal sealed partial class NamePropertyHandler
        {
            protected override void OnValueChanged(MappingSourceBase element, string oldValue, string newValue)
            {
                base.OnValueChanged(element, oldValue, newValue);
                element.PropertyChange("Name");
            }
        }

        protected void PropertyChange(string propertyName)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }

        public event PropertyChangedEventHandler PropertyChanged;
    }

}
